package com.mmy.fta.cargo.server.enums;

/**
 * @author guohao.xie
 * @apiNote
 * @exportable
 * @since 2021/11/2
 */
public enum CargoStatusEnum {
    //发布中10
    ANNOUNCING(10,"announcing"),

    //已下单20
    ORDER_PLACED(20,"Order_placed"),

    //已完成30
    COMPLETE(30,"completed"),

    //已下架40
    DOWN(40,"down"),

    //已取消-1
    CANCELED(-1,"CANCELED");

    private int code;
    private String msg;

    private CargoStatusEnum(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return this.code;
    }

    public String getMsg() {
        return this.msg;
    }

    public static CargoStatusEnum cargoStatusEnum(Integer code) {
        if (null == code) {
            return null;
        } else {
            CargoStatusEnum[] var1 = values();
            int var2 = var1.length;

            for (int var3 = 0; var3 < var2; ++var3) {
                CargoStatusEnum cargoStatusEnum = var1[var3];
                if (cargoStatusEnum.code == code) {
                    return cargoStatusEnum;
                }
            }

            return null;
        }
    }


}
